﻿@model Xms.Web.Models.EditUserPasswordModel

<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">
            <a data-toggle="collapse"
               href="#collapseTwo">
                <strong>@app.PrivilegeTree?.LastOrDefault().DisplayName</strong>
            </a>
        </h3>
    </div>
    <div id="collapseTwo" class="panel-collapse collapse in">
        <div class="panel-body">
            @using (Html.BeginForm("EditUserPassword", "security", FormMethod.Post, new { @id = "editform", @class = "form-horizontal" }))
            {
                @Html.AntiForgeryToken()
                @Html.HiddenFor(x => x.SystemUserId)
                <div class="form-group col-sm-12">
                    <label class="col-sm-2 control-label" for="Name">@app.T["user_name"]</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" value="@Model.Name" disabled />
                    </div>
                </div>
                <div class="form-group col-sm-12">
                    @Html.LabelFor(x => x.NewPassword, app.T["user_newpassword"], new { @class = "col-sm-2 control-label" })
                    <div class="col-sm-10">
                        @Html.PasswordFor(x => x.NewPassword, new { @class = "form-control", @size = "16" })
                    </div>
                </div>
                <div class="form-group col-sm-12">
                    @Html.LabelFor(x => x.ConfirmPassword, app.T["user_newpassword_confirm"], new { @class = "col-sm-2 control-label" })
                    <div class="col-sm-10">
                        @Html.PasswordFor(x => x.ConfirmPassword, new { @class = "form-control", @size = "16" })
                    </div>
                </div>
                <div class="form-group col-sm-12 text-center" id="form-buttons">
                    <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-saved"></span> @app.T["save"]</button>
                    <button type="reset" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> @app.T["reset"]</button>
                </div>
            }
        </div>
    </div>
</div>
@section Scripts {
    <script src="/content/js/jquery.form.js?v=@app.PlatformSettings.VersionNumber"></script>
    <script src="/content/js/jquery-validate/jquery.validate.min.js?v=@app.PlatformSettings.VersionNumber"></script>
    <script src="/content/js/jquery-validate/localization/messages_zh.min.js?v=@app.PlatformSettings.VersionNumber"></script>
    <script>
        $(function () {
            //表单验证
            Xms.Web.Form($("#editform"));
        });
    </script>
}